package com.yao.servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

@WebServlet(name = "IndexServlet", value = {"/index.html","/"})
public class IndexServlet extends BaseServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("这是主页");
        Map<String,Object> variables=new HashMap<>();
        variables.put("a",123);
        variables.put("b","hello");
        this.process("index",variables,request,response);
    }
}
